package com.grad.webstudy.dao;

import com.grad.webstudy.model.CourseComment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface CoursecommentDao {
    int deleteByPrimaryKey(Integer id);


    int insertSelective(CourseComment record);

    CourseComment selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CourseComment record);

    int updateByPrimaryKey(CourseComment record);

    /**
     * 数据库插入回复内容
     * @param record
     * @return
     */
    int insert(CourseComment record);


    /**
     * 根据id和用户id删除评论
     * @param userId
     * @param ids
     * @return
     */
    int deleteByIds(@Param("ids") List<String> ids,@Param("userId") Integer userId);


    /**
     * 根据课程id查询评论
     * @param courseDetailId
     * @return
     */
    List<CourseComment> selectByCourseDetailId(Integer courseDetailId);


    /**
     * 根据用户id查询评论
     * @param userId
     * @return
     */
    List<CourseComment> selectByUserId(Integer userId);


    /**
     * 查询全部评论信息
     * @return
     */
    List<CourseComment> queryAll();
}